package com.yc.yn.model;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@SuppressWarnings("serial")
@Entity
@Table(name = "t_s_chatMsg")
@org.hibernate.annotations.Table(appliesTo = "t_s_chatMsg", comment = "聊天记录表")
public class TSChatMsg extends IdEntity implements Serializable {

	private String sendUserId;

	private String acceptUserId;
	private String msg;

	private Integer signFlag;


	private Date createTime;

	@Column(columnDefinition = "varchar(32) NOT NULL COMMENT '发送者id'")
	public String getSendUserId() {
		return sendUserId;
	}

	public void setSendUserId(String sendUserId) {
		this.sendUserId = sendUserId;
	}

	@Column(columnDefinition = "varchar(32) NOT NULL COMMENT '接收者id'")
	public String getAcceptUserId() {
		return acceptUserId;
	}

	public void setAcceptUserId(String acceptUserId) {
		this.acceptUserId = acceptUserId;
	}

	@Column(columnDefinition = "varchar(255) NOT NULL COMMENT '发送的消息'")
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Column(columnDefinition = "int(1) NOT NULL COMMENT '消息是否签收状态 1签收0未签收'")
	public Integer getSignFlag() {
		return signFlag;
	}

	public void setSignFlag(Integer signFlag) {
		this.signFlag = signFlag;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Column(columnDefinition = "datetime NOT NULL COMMENT '发送请求的时间'")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
}